import { Browser, BrowserHrm } from 'weaver-mobile-page'
import { Tools } from 'weaver-mobile'
import { observable, action } from 'mobx'
const getLabel = Tools.getLabel;
export default class GoalMainAdvanceSearchStore {

    
    @observable
    orderbyFieldOptions = [
        {
            key: "",
            showname: getLabel(19520 ,'最后修改时间')
        },{
            key: "enddate",
            showname: getLabel(741,'结束日期')
        },{
            key: "principalid",
            showname: getLabel(16936,'责任人')
        }
    ]

    @observable
    orderbyTypeOptions = [
        {
            key: "asc",
            showname: getLabel(339,'升序')
        },{
            key: "desc",
            showname: getLabel(340,'降序')
        }
    ]


    @observable 
    goalMainHrmPrincipalBrowserStore = new BrowserHrm.Store({ route: '/goalHome/mainAdvancedSearch' })

    @observable
    tagBrowser = new Browser.Store({ route: '/goalHome/mainAdvancedSearch'}); //标签设置

    @observable
    goalName = ""

    @action
    changeGoalName = (goalName) => {
        this.goalName = goalName
    }

    @observable
    principal = []

    @action
    changePrincipal = (principal) => {
        this.principal = principal
    }

    @observable
    endDate = ""

    @action
    changeEndDate = (endDate) => {
        this.endDate = endDate
    }

    @observable
    endDateT = ""

    @action
    changeEndDateT = (endDateT) => {
        this.endDateT = endDateT
    }


    //排序方式
    @observable
    orderby = ""

    @action
    changeOrderby = (orderby) => {
        this.orderby = orderby
    }

    @observable
    orderbytype = "desc"

    @action
    changeOrderbytype = (orderbytype) => {
        this.orderbytype = orderbytype
    }

    @observable
    tagArray = []

    @action
    changeTagArray = (tagArray) =>{
        this.tagArray = tagArray;
    }

    @action
    reset = () =>{
        this.changeGoalName("");
        this.changePrincipal([]);
        this.changeEndDate("")
        this.changeEndDateT("");
        this.changeOrderby("");
        this.changeOrderbytype("");
        this.changeTagArray([]);
    }


}